# gen.py
import random
import string
import time

def generate_random_string(length):
    """生成指定长度的随机字符串"""
    return ''.join(random.choices(string.ascii_lowercase, k=length))

def generate_test_cases(num_cases, min_length, max_length):
    """生成测试用例"""
    test_cases = []
    for _ in range(num_cases):
        length = random.randint(min_length, max_length)
        test_cases.append(generate_random_string(length))
    return test_cases

if __name__ == "__main__":
    # 使用当前时间作为随机种子
    random.seed(int(time.time()))
    
    # 生成10个长度在5到15之间的随机字符串作为测试用例
    test_cases = generate_test_cases(10, 5, 15)
    
    # 将测试用例保存到文件
    with open("test_cases.txt", "w") as file:
        for case in test_cases:
            file.write(case + "\n")
